<!DOCTYPE html>  
<html>  
  <head>  
    <title>Inheritance</title>  
  </head>
  <body>  
    <script type="text/javascript">
      class Vehicle {
        brand = "Ford"; // Vehicle attribute

        honk() { // Vehicle method
          document.write("Tuut, tuut!<br>");
        }
      }
      
      class Car extends Vehicle
      {  
        modelName = "Mustang"; // Car attribute
      };
      
      var myCar = new Car();
      // Call the honk() method (from the Vehicle class) on the myCar object
      myCar.honk();

      // Display the value of the brand attribute (from the Vehicle class) and the
      // value of the modelName from the Car class
      document.write(myCar.brand + " " + myCar.modelName);
    </script> 
  </body>  
</html>